<template>
  <div>
    <button @click="show">弹出</button>
    <SlideSelect ref="vSlideSelect"/>
  </div>
</template>

<script>
import SlideSelect from './SlideSelect'
export default {
  components: {
    SlideSelect
  },
  mounted () {
    this.show()
  },
  methods: {
    show () {
      this.$refs.vSlideSelect.show({
        titles: ['开始时间', '结束时间'],
        lists: [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]],
        // selectedIndexs: [0, 0], // 当前选择，通过重新赋值控制子组件选择
        selectedValues: [2], // 当前选择
        onConfirm (selectedValues) {
          console.log(selectedValues)
          return false // 可阻止关闭
        }
      })
    }
  }
}
</script>

